<html>
<head><meta charset="utf-8"><title>sigsegvs · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html">sigsegvs</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="131035078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131035078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131035078">(Aug 07 2018 at 10:21)</a>:</h4>
<p>It appears to be fairly commonplace for the compiler to segfault lately (<a href="https://github.com/rust-lang/rust/issues/53149" target="_blank" title="https://github.com/rust-lang/rust/issues/53149">#53149</a>, <a href="https://github.com/rust-lang/rust/issues/53099" target="_blank" title="https://github.com/rust-lang/rust/issues/53099">#53099</a>, <a href="https://github.com/rust-lang/rust/issues/53083" target="_blank" title="https://github.com/rust-lang/rust/issues/53083">#53083</a>, <a href="https://github.com/rust-lang/rust/issues/52884" target="_blank" title="https://github.com/rust-lang/rust/issues/52884">#52884</a>). My bet is on LLVM assertion firing, but since they are not enabled, it is not clear what it is that we’re dealing with.</p>



<a name="131035128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131035128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131035128">(Aug 07 2018 at 10:22)</a>:</h4>
<p>we probbaly should have an easier method to try LLVM with assertions, possibly as a separate codegen backend <span class="emoji emoji-1f642" title="slight smile">:slight_smile:</span></p>



<a name="131036140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131036140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131036140">(Aug 07 2018 at 10:46)</a>:</h4>
<p>In the period leading up to an LLVM upgrade and immediate following it, we probably should enable LLVM assertions, no?</p>



<a name="131036150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131036150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131036150">(Aug 07 2018 at 10:46)</a>:</h4>
<p>At least, it seems like it would be a good way to try to catch issues.</p>



<a name="131036161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131036161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131036161">(Aug 07 2018 at 10:47)</a>:</h4>
<p>but then again, for all I know people <em>do</em> re-enable LLVM assertions when testing an upgrade locally</p>



<a name="131038229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131038229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131038229">(Aug 07 2018 at 11:28)</a>:</h4>
<p>I usually have them enabled for all my local builds</p>



<a name="131038331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131038331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131038331">(Aug 07 2018 at 11:31)</a>:</h4>
<p>i think I used to do that, but then I got frustrated because the ones that were asserting on master weren't getting fixed</p>



<a name="131038619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131038619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131038619">(Aug 07 2018 at 11:37)</a>:</h4>
<p>We do have CI runners with LLVM assertions enabled though, don't we?</p>



<a name="131038977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131038977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131038977">(Aug 07 2018 at 11:44)</a>:</h4>
<blockquote>
<p>It appears to be fairly commonplace for the compiler to segfault lately (<a href="https://github.com/rust-lang/rust/issues/53149" target="_blank" title="https://github.com/rust-lang/rust/issues/53149">#53149</a>, <a href="https://github.com/rust-lang/rust/issues/53099" target="_blank" title="https://github.com/rust-lang/rust/issues/53099">#53099</a>, <a href="https://github.com/rust-lang/rust/issues/53083" target="_blank" title="https://github.com/rust-lang/rust/issues/53083">#53083</a>, <a href="https://github.com/rust-lang/rust/issues/52884" target="_blank" title="https://github.com/rust-lang/rust/issues/52884">#52884</a>). My bet is on LLVM assertion firing, but since they are not enabled, it is not clear what it is that we’re dealing with.</p>
</blockquote>
<p>seems bad... I wonder how we can test this theory most effectively?</p>



<a name="131038986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131038986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131038986">(Aug 07 2018 at 11:44)</a>:</h4>
<p>is there an easy way for us to tell people to enable assertions?</p>



<a name="131040497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131040497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131040497">(Aug 07 2018 at 12:17)</a>:</h4>
<p>No, but we could have one by building a codegen backend that has assertions enabled, in addition to our current backend that doesn’t. Since the backend is just a shared library, conceiving a method for swapping it out should be not too hard.</p>



<a name="131040552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131040552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131040552">(Aug 07 2018 at 12:18)</a>:</h4>
<p>Alas, the backend is full of <code>extern "Rust"</code> functions IIRC, which makes it not really portable.</p>



<a name="131041217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131041217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131041217">(Aug 07 2018 at 12:31)</a>:</h4>
<blockquote>
<p>No, but we could have one by building a codegen backend that has assertions enabled, in addition to our current backend that doesn’t. Since the backend is just a shared library, conceiving a method for swapping it out should be not too hard.</p>
</blockquote>
<p>interesting</p>



<a name="131041227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131041227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131041227">(Aug 07 2018 at 12:31)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> portable in what sense?</p>



<a name="131041538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131041538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131041538">(Aug 07 2018 at 12:38)</a>:</h4>
<p>in a sense of having a single .so for a single version of LLVM that can be used across many versions of rustc.</p>



<a name="131041564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131041564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131041564">(Aug 07 2018 at 12:39)</a>:</h4>
<p>ah ok</p>



<a name="131046609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131046609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131046609">(Aug 07 2018 at 14:09)</a>:</h4>
<p>We have 64bit linux binaries with LLVM asserts for each commit</p>



<a name="131046625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131046625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131046625">(Aug 07 2018 at 14:10)</a>:</h4>
<p>No good way to get them via rustup but <a href="https://crates.io/crates/rustup-toolchain-install-master" target="_blank" title="https://crates.io/crates/rustup-toolchain-install-master">https://crates.io/crates/rustup-toolchain-install-master</a> can do it (--alt flag I believe)</p>



<a name="131046706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131046706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131046706">(Aug 07 2018 at 14:10)</a>:</h4>
<p>I think we might be able to ship two backends like we do with emscripten and normal LLVM, adding a assertions-enabled backend that can be enabled via some environment variable or compiler flag</p>



<a name="131059244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131059244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131059244">(Aug 07 2018 at 17:56)</a>:</h4>
<p>but we don’t really want to do that, could as well just ship assertion enabled nightlies in that case</p>



<a name="131059264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131059264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131059264">(Aug 07 2018 at 17:56)</a>:</h4>
<p>There are many reasons we disabled assertions in nightlies in the first place and shipping multiple llvms just for assertions would defeat about 99% of those reasons.</p>



<a name="131060264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131060264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131060264">(Aug 07 2018 at 18:11)</a>:</h4>
<p>I think most had to do with performance so a switch-enabled assertion build might not be too bad</p>



<a name="131062334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131062334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131062334">(Aug 07 2018 at 18:49)</a>:</h4>
<p>I thought it was primarily driven by perf, yeah</p>



<a name="131062395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131062395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131062395">(Aug 07 2018 at 18:50)</a>:</h4>
<p>that said, how certain are we that LLVM assertions are relevant here?</p>



<a name="131062400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131062400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131062400">(Aug 07 2018 at 18:50)</a>:</h4>
<p>is there a way to test that hypothesis?</p>



<a name="131062510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131062510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131062510">(Aug 07 2018 at 18:53)</a>:</h4>
<p>Well, I know for sure that LLVM, when assertions are disabled, just replaces them with a trap. So, usually, when I see a SIGSEGV or SIGILL in LLVM somewhere (some of those issues have LLVM in their backtraces) I’m fairly confident in it being an assert.</p>



<a name="131066167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131066167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131066167">(Aug 07 2018 at 20:06)</a>:</h4>
<p>I guess what I meant is, is there some mechanism (e.g., alt-builds?) we can use today to reproduce this?</p>



<a name="131066426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/sigsegvs/near/131066426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/sigsegvs.html#131066426">(Aug 07 2018 at 20:12)</a>:</h4>
<p>We do have alt builds for every commit, which have LLVM asserts enabled. I'm not sure how much that helps, though...</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>